package com.app.adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import com.app.R;
import com.app.bean.ClassmateListBean;

import java.util.ArrayList;

public class ClassmateListAdapter extends BaseAdapter {
    private Context context;
    private ArrayList<ClassmateListBean.ListBean> listBeen;

    public ClassmateListAdapter(Context context, ArrayList<ClassmateListBean.ListBean> listBeen) {
        this.context = context;
        this.listBeen = listBeen;
    }

    public ClassmateListAdapter() {
    }

    @Override
    public int getCount() {
        return listBeen.size();
    }

    @Override
    public Object getItem(int position) {
        return listBeen.get(position);
    }

    @Override
    public long getItemId(int position) {
        return listBeen.get(position).getId();
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        convertView = View.inflate(context, R.layout.item_classmate,null);
        TextView classMateName = (TextView) convertView.findViewById(R.id.tv_name);
        classMateName.setText(listBeen.get(position).getName()+"");
        return convertView;
    }
}
